package cn.edu.lingnan.lsqn.dao;

import java.util.List;

import cn.cdahua.basic.dao.IBaseDao;
import cn.cdahua.basic.model.Pager;
import cn.edu.lingnan.lsqn.model.Group;
import cn.edu.lingnan.lsqn.model.Role;
import cn.edu.lingnan.lsqn.model.User;

public interface IUserDao extends IBaseDao<User> {

	public void deleteUsergroupById(int id);

	public void deleteUserroleById(int id);

	public User loadByName(String username);

	public List<User> list(String hql, Object[] args);

	public List<User> list(String hql, Object arg);

	public List<User> list(String hql);

	public List<User> list();

	public Pager<User> find(String hql, Object[] args);

	public Pager<User> find(String hql, Object arg);

	public Pager<User> find(String hql);

	public Pager<User> find();

	public void updateByHql(String hql, Object[] args);

	public void updateByHql(String hql, Object arg);

	public void updateByHql(String hql);

	public void addUserRole(User user, Role role);

	public void addUserGroup(User user, Group group);

	public List<Group> listUserGroup(int id);

	public List<Role> listUserRole(int id);

	public List<Integer> listUserRoleIds(int id);

	public List<Integer> listUserGroupIds(int id);

	public Pager<User> listUserByGroup(int g_id);

	public Pager<User> listUserByRole(int r_id);

	public User loadByEmail(String email);

}
